package gwt.trading.client;

import gwt.trading.client.geometry.Point;

/**
 * @author Iulian Costan (iulian.costan@gmail.com)
 *
 */
public class HorizontalAxis extends Axis {
	
	private int height;
	private int periods;
	
	public HorizontalAxis(int periods) {
		this(periods, TradingChartSettings.HORIZONTAL_AXIS_WIDTH);
	}
	
	public HorizontalAxis(int periods, int height) {
		this.periods = periods;
		this.height = height;
	}

	public void draw(Renderer renderer) {
		int xMinPosition = getDrawingBoard().getMinXPosition();
		int xMaxPosition = getDrawingBoard().getMaxXPosition();
		int yPosition = getDrawingBoard().getMinYPosition();
		
		Point start = new Point(xMinPosition, yPosition);
		Point end = new Point(xMaxPosition, yPosition);
		
		// draw vertical line
		renderer.drawLine(new Line(start, end, getColor()));
	}

	public int getHeight() {
		return height;
	}

	public int getPeriods() {
		return periods;
	}
	
	
}
